# -*-coding:utf-8 -*-
def add(sums1: int, sums2: int) -> int:
    return sums1 + sums2


def subtract(sums1: int, sums2: int) -> int:
    return sums1 - sums2


def multiply(sums1: int, sums2: int) -> int:
    return sums1 * sums2


def divide(sums1: int, sums2: int) -> int:
    if sums2 != 0:
        return sums1 / sums2
    else:
        return "除数不能为0"
    

def main() -> None:
    num1 = input("请输入第一个数：")
    operator = input("请输入运算符（+ - * /）：")
    num2 = input("请输入第二个数：")
    if not num1.isdigit() or not num2.isdigit():
        print("操作数必须为整数！")
        return
    num1 = int(num1)
    num2 = int(num2)
    if operator == "+":
        result = add(num1, num2)
    elif operator == "-":
        result = subtract(num1, num2)
    elif operator == "*":
        result = multiply(num1, num2)
    elif operator == "/":
        result = divide(num1, num2)
    else:
        result = "无效运算符！"
    print("计算结果：", result)


if __name__ == "__main__":
    main()
    